package com.principle.lkp;

import java.util.Random;

/**
 * @author yangguanzan
 * @date 3/10/22
 * @description
 */
public class Wizard {

    private Random random = new Random(System.currentTimeMillis());

    private final static int NUM = 100;

    private final static int NUM4NEXT = 50;
    private int first(){
        System.out.println("执行第一步");
        return random.nextInt(NUM);
    }

    private int second(){
        System.out.println("执行第二步");
        return random.nextInt(NUM);
    }

    private int third(){
        System.out.println("执行第三步");
        return random.nextInt(NUM);
    }

    public void install() {
        int first = this.first();
        if(first > NUM4NEXT){
            int second = this.second();
            if (second > NUM4NEXT){
                int third = this.third();
                if(third > NUM4NEXT ){
                    System.out.println("即将执行完毕");
                }
            }
        }

    }
}
